
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class SENT_OUT_MESSAGEMap : EntityTypeConfiguration<SENT_OUT_MESSAGE>
    {
        public SENT_OUT_MESSAGEMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.TEL_NO)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.USER_NAME)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Message_body)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("SENT_OUT_MESSAGE");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.REPAIR_ORDER_ID).HasColumnName("REPAIR_ORDER_ID");
            this.Property(t => t.TEL_NO).HasColumnName("TEL_NO");
            this.Property(t => t.USER_NAME).HasColumnName("USER_NAME");
            this.Property(t => t.Message_body).HasColumnName("Message_body");
            this.Property(t => t.Message_Type).HasColumnName("Message_Type");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
        }
    }
}
